package org.example.Segregate;

public class Validator {
    private final ValifsyionStrategy strategy;

    // 聚合
    public Validator(ValifsyionStrategy strategy) {
        this.strategy = strategy;
    }

    public boolean validate(String str) {
        return strategy.excute(str);
    }
}
